﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>中国传媒大学设备预约平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="{$projectUrl}/css/admin_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$projectUrl}/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/jquery.cycle.all.min.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/globalJsFunction.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/calendar/calendar.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/calendar/WdatePicker.js"></script>
<script type="text/javascript">
{literal}
$(document).ready(function(){
    $('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 3000,
        pager:  '#slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
    {/literal}
        {if $notice neq ""}
            alert("{$notice}");
        {/if}
    {literal}
});
{/literal}

</script>
</head>
<body>
<div class="main">
  <div class="main_resize">
    <div class="main_left">
      {include file=include/headerLogo.html}
      <div class="clr"></div>
      <ul class="navvylist">
      <li><a href="message.php?action=create&view=recieve">写信息</a></li>
        <li><a href="message.php?view=recieve">收件箱{if $newMessageNumber gt "0"}<span style="color:red">{$newMessageNumber}个新邮件</span>{/if}</a></li>
        <li><a href="message.php?view=send">已发送 </a></li>
        </ul>
      <div class="clr"></div>
    </div>
    <div class="main_right">
      {include file=include/headerLogin.html}

      <div class="clr" style="background-color:#C63; height:1px;">&nbsp;</div>
      <div>
      {include file=include/adminTopMenu.html}
      </div>
      <div class="clr">


      </div>

      <!-- 搜索用户并且进行修改 -->
      <div class="clr">

    {if $action eq "reply" || $action eq "create"}
    <form action="message.php?action=send&view={$view}" method="post">
      <table width="100%" align="center" bgcolor="#c63">
      <tr>
      <td align="right">收件人帐号</td>
      <td align="left"><input type="text" name="recieveid" id="recieveid" value="{$recieveuserinfo.id}"/></span>
      </td>
      </tr>
      <tr>
      <td align="right">标题</td>
      <td align="left">
      {if $action eq "reply"}
      <input type="text" id="title" name="title" size="40" value="Re:{$currentMessage.title|escape:'html'}"/>
      {else}
      <input type="text" id="title" name="title" size="40"/>
      {/if}
      </td>
      </tr>
      <tr>
      <td align="right">内容</td>
      <td align="left">
      <textarea id="content" name="content" cols="100%" rows="20">
      {$currentMesssage.content |truncate:'100'|escape:'html'}
      </textarea>
      </td>
      </tr>
      <tr>
      <td colspan="2" align="center"><input type="submit" value="发送"/></td>
      </tr>
      </table>
     </form>
     {/if}

     <!--打开邮件-->
     {if $action eq "open"}
      <table align="left">
      <tr>
      <td align="left"><span>标题</span></td>
      <td align="left">{$currentMessage.title|escape:'html'}
      </td>
      </tr>
      <tr>
      <td align="left"><span>发件</span></td>
      <td align="left">
      {$currentMessage.senduser}({$currentMessage.sendname})
      </tr>
      <tr>
      <td align="left"><span>内容</span></td>
      <td align="left">{$currentMessage.content|escape:'html'}</td>
      </tr>
      <tr>
       <td colspan="2" align="center">
       {if $view eq "recieve"}
       <a href="message.php?view={$view}&action=reply&recieveid={$currentMessage.senduid}&recieveusertype={$currentMessage.sendusertype}&messageid={$currentMessage.id}">回复</a>{/if}</td>
      </tr>
      </table>
     {/if}

       <!--全部用户的列表-->
       <table width="100%">
      <tr>
      <td colspan="7">站内信件个数：{$messagelist|@count}</td>
      </tr>
      <tr bgcolor="#C63" style="font-size:14px">
      <td>删除</td>
      <td>标题</td>
      <td>内容</td>
      <td>发送者</td>
      <td>日期</td>
      <td>打开</td>
      <td>回复</td>
      </tr>
      {foreach from=$messagelist item=item name=messagedetails}
      {if $item.read eq "0" && $view eq "recieve"}
      <tr bgcolor="#EE00">
      {else}
      <tr bgcolor="#fa8">
      {/if}

      <td><a href="message.php?action=delete&view={$view}&messageid={$item.id}">×</a></td>
      <td>
      <span title="{$item.title|escape:'html'}">
        {$item.title|escape:'html'|truncate:10}
        </span></td>
      <td><span title="{$item.content|escape:'html'}">{$item.content|escape:'html'|truncate:30}</span></td>
      <td>{$item.sendname|escape:'html'}({$item.senduser})</td>
      <td>{$item.createtime}</td>
      <td><a href="message.php?action=open&view={$view}&messageid={$item.id}">打开</a></td>

      <td>
      {if $view eq "recieve"}
      <a href="message.php?action=reply&view={$view}&messageid={$item.id}&recieveid={$item.senduid}&recieveusertype={$item.senduid_type}">回复</a>
      {/if}
      </td>
      </tr>
      {/foreach}
      </table>
                <!--全部用户的列表-->
      </div>
      <!-- 搜索用户并且进行修改 结束-->
      <div class="clr"></div>



    </div>

    <!-- 展示用户的课程列表 -->
    <div class="clr">

    </div>
  </div>
  <div class="footer">
    {include file=include/footer.html}
  </div>
</div>
<div align=center></div></body>
</html>
